package com.patternsbox.behavioral.observer;

import com.patternsbox.ActionTemplate;

public class ObserverAction extends ActionTemplate {

	public void doAction() {
		
	      // Configure Observer pattern
	      Subject s = new ConcreteSubject();
	      s.attach(new ConcreteObserver(s, "X"));
	      s.attach(new ConcreteObserver(s, "Y"));
	      s.attach(new ConcreteObserver(s, "Z"));
	      // Change subject and notify observers
	      s.setSubjectState("ABC");
	      s.notifyObservers();
	}
}
